﻿@model dynamic
@{
    Layout = null;
}
<div class="home-desktop">
    <div class="content-pages-title">
        <h1>编辑材质分类</h1>
    </div>
    <div class="content-notice-body">
        <div class="modular-info" style="display: block;">
            <form action="@(Url.Action("Modify"))" method="post" id="form-edit-basicMaterialCatalog">
                <table style="width: 100%; border: none;">
                    <tr>
                        <td valign="top">
                            <div class="notice-box-left">
                                <div class="modular-info" style="display: block;">
                                    <ul class="form">
                                        <li>
                                            <em>分类标识</em>
                                            <input type="text" value="@Model.Identifier" name="identifier" maxlength="20" required />
                                        </li>
                                        <li>
                                            <em>英文名</em>
                                            <input type="text" value="@Model.EName" name="ename" maxlength="200" required />
                                        </li>
                                        <li>
                                            <em>中文名</em>
                                            <input type="text" value="@Model.CName" name="cname" maxlength="200" required />
                                        </li>
                                        <li class="row-last">
                                            <em>&nbsp;</em>&nbsp;&nbsp;
                                            <button type="button" class="cotrlBtn btnBlue" id="btn_save">保存</button>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $("#btn_save").click(function () {
        if ($('#form-edit-basicMaterialCatalog').valid()) {
            $("#form-edit-basicMaterialCatalog").ajaxSubmit({
                datatype: "json",
                data: $('#form-edit-basicMaterialCatalog').serialize(),
                success: function (result) {
                     if (result.code == 0) {
                        dcAlert(result.message, 0, 1, function () {
                            $(".layer-dialog-close-btn").click();
                            //刷新显示数据
                            btn_search_click();
                        });
                    }
                    else {
                        dcAlert(result.message, 0, 2);
                    }
                }
            });
        }
    });
</script>
